<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a>
                    <cite>查看所有商品</cite>
                </a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" action="" method="get">
                        <div class="layui-input-inline layui-show-xs-block">
                            <input class="layui-input" placeholder="开始日" name="start" id="start"></div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <input class="layui-input" placeholder="截止日" name="end" id="end"></div>

                        <div class="layui-input-inline layui-show-xs-block">
                            <input type="text" name="name" placeholder="请输入名称" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                <i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>
<!--                <div class="layui-card-header">

                    <button class="layui-btn" onclick="xadmin.open('添加用户','/home/goods/adds',500,250)">
                        <i class="layui-icon"></i>添加</button>
                </div>-->
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>商品名称</th>
                            <th>价格</th>
                            <th>总数量</th>
                            <th>创建时间</th>
                        </thead>
                        <tbody>
                        {volist name="list" id="vo"}
                        <tr>
                            <td>
                                <img src="/static/ico/id.png"/>
                                {$vo.id}
                            </td>
                            <td>
                                <img src="/static/ico/goods_name.png"/>
                                {$vo.name}
                            </td>
                            <td>
                                <img src="/static/ico/price.png"/>
                                {$vo.price}元
                            </td>
                            <td>
                                <img src="/static/ico/number.png"/>
                                {$vo.number}
                            </td>
                            <td>
                                <img src="/static/ico/time.png"/>
                                {:date('Y-m-d H:i:s',$vo.create_time)}
                            </td>
                <!--            <td class="td-manage">
                                <a title="查看" onclick="show({$vo.id})" href="javascript:;">
                                    <i class="layui-icon">&#xe63c;</i>查看数量</a>

                            </td>-->
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$list|raw}
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function show(id) {
        alert(id);
        $.ajax({
            type:"post",
            url: "{:url('home/goods/edits')}",
            data: {
                name:$('#name').val(),
                price:$('#price').val(),
                id:$('#id').val(),
            },
            success: function(data){
                console.log(data);
                toastr.error(data.msg);
                if(data.code == 100){
                    setTimeout(function () {
                        layer.closeAll();
                        parent.location.reload();
                    },1500);
                }
            }});
    }
</script>


</html>